package ChainOfResponbilityPattern;

/**
 * @author： pang-yun
 * @date： 2022-01-06 19:06
 * 功能目的 ：用于
 */

public class Client {
    public static void main(String[] args) {
        PurchaseRequest purchaseRequest = new PurchaseRequest(1,1,300000);

        //创建相关审批人
        DepartmentApprover departmentApprover = new DepartmentApprover("部门负责人");
        CollegeApprover collegeApprover = new CollegeApprover("学院负责人");
        ViceSchoolMasterApprover viceSchoolMasterApprover = new ViceSchoolMasterApprover("副校长");
        SchoolMasterApprover schoolMasterApprover = new SchoolMasterApprover("校长");

        // 将审批人级别的下一级设置好
        departmentApprover.setApprover(collegeApprover);
        collegeApprover.setApprover(viceSchoolMasterApprover);
        viceSchoolMasterApprover.setApprover(schoolMasterApprover);

        departmentApprover.processRequest(purchaseRequest);

    }
}
